#! /bin/sh /usr/share/dpatch/dpatch-run
## ubuntu_hardening.dpatch by Devid Antonio Filoni <d.filoni@ubuntu.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: fix FTBFS caused by -D_FORTIFY_SOURCE=2 flag enabled in Ubuntu.

@DPATCH@
diff -urNad pcmanx-gtk2-0.3.7~/src/core/fileutil.c pcmanx-gtk2-0.3.7/src/core/fileutil.c
--- pcmanx-gtk2-0.3.7~/src/core/fileutil.c	2007-08-29 05:23:19.000000000 +0200
+++ pcmanx-gtk2-0.3.7/src/core/fileutil.c	2008-09-07 23:59:56.071855143 +0200
@@ -17,7 +17,7 @@
 		/* File already exists */
 		if( !overwrite && !access( dest, F_OK) )
 			return 0;
-		if( -1 != (fddest = open(dest, O_CREAT|O_WRONLY|O_TRUNC) ) )
+		if( -1 != (fddest = open(dest, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR|S_IWUSR) ) )
 		{
 			while( (rlen = read( fdsrc, buf, sizeof(buf) )) )
 				write( fddest, buf, rlen );
